pub fn new_birthday_probability(n: u32) -> f64 {
  if n < 2 {
    return 0.0;
  }

  let mut probability_no_shared = 1.0;
  let days_in_year = 365;

  for i in 0..n {
    probability_no_shared *= (days_in_year - i) as f64 / days_in_year as f64;
  }

  // 至少两人共享生日的概率
  let probability_shared = 1.0 - probability_no_shared;

  // 保留四位小数
  (probability_shared * 10000.0).round() / 10000.0
}
